import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue'),
    children: [
      {
        path: '/home',
        redirect: '/home/index'
      },
      {
        path: 'index',
        title: '首页',
        component: () => import(/* webpackChunkName: "about" */ '../views/children/Index.vue')
      },
      {
        path: 'room',
        title: '找房',
        component: () => import(/* webpackChunkName: "about" */ '../views/children/Room.vue')
      },
      {
        path: 'my',
        title: '我的',
        component: () => import(/* webpackChunkName: "about" */ '../views/children/My.vue')
      }
    ]
  },
  {
    path: '/map',
    component: () => import(/* webpackChunkName: "about" */ '../views/Map.vue')
  },
  // {
  //   path: '/map2',
  //   component: () => import(/* webpackChunkName: "about" */ '../views/Map2.vue')
  // },
  {
    path: '/citylist',
    component: () => import(/* webpackChunkName: "about" */ '../views/Citylist.vue')
  },
  {
    path: '/issueroom',
    component: () => import(/* webpackChunkName: "about" */ '../views/Issueroom.vue')
  },
  {
    path: '/record',
    component: () => import(/* webpackChunkName: "about" */ '../views/Record.vue')
  },
  {
    path: '/rentarch',
    component: () => import(/* webpackChunkName: "about" */ '../views/Rentarch.vue')
  },
  {
    path: '/detail',
    component: () => import(/* webpackChunkName: "about" */ '../views/Detail.vue')
  },
  {
    path: '/login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login/login.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
